<?php

namespace common\widgets;

use yii\widgets\ActiveField;

class MyField extends ActiveField
{
    public $template = "{input}\n{error}";

    public function begin()
    {
        if ($this->form->enableClientScript) {
            $clientOptions = $this->getClientOptions();
            if (!empty($clientOptions)) {
                $this->form->attributes[] = $clientOptions;
            }
        }
    }

    public function end()
    {

    }
}